//
//  GGAutoScrollCollectionReusableView.m
//  Gunterapple
//
//  Created by 热带雨林 on 2020/3/31.
//  Copyright © 2020 热带雨林. All rights reserved.
//

#import "GGAutoScrollCollectionReusableView.h"

@interface GGAutoScrollCollectionReusableView ()
@property (nonatomic, strong) UIButton *clickBtn;
@end

@implementation GGAutoScrollCollectionReusableView
- (instancetype)initWithFrame:(CGRect)frame{
    if(self = [super initWithFrame:frame]){
        [self setUI];
    }
    return self;
}
- (void)setUI{
    
    self.backgroundColor = [UIColor yellowColor];
    self.clickBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.frame), CGRectGetHeight(self.frame))];
    [self addSubview:self.clickBtn];
    [self.clickBtn addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
    
}

- (void)click:(UIButton *)sender{
    sender.selected = !sender.selected; //反选
    if([self.delegate respondsToSelector:@selector(changeWithType:)]){
        [self.delegate changeWithType:sender.selected];
    }
}
@end
